﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HSPCS.BLL;
using System.Data;
namespace HSPCS.Web
{
    public partial class _Default : Page
    {
        DataBLL dataBLL = new DataBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable listTable = new DataTable();
            listTable = dataBLL.GetTableList();
            foreach (DataRow r in listTable.Rows)
            {
                ShowColumn(r[0].ToString()+"."+r[1].ToString());
            }
        }

        public void ShowColumn(string tableName)
        {
            Literal Literal1 = new Literal();
            Literal1.Text = "<br><h4><a class=\"dialog\" data-href=\"GenControl.aspx?tableName=" + tableName + "\">" + tableName + "</a></h4>";
            //Literal1.Text = "<br><h4><a class=\"dialog\" data-href=\"http://www.genk.vn\">" + tableName + "</a></h4>";
            myPlaceHolder.Controls.Add(Literal1);
            DataTable listColumn = new DataTable();
            listColumn = dataBLL.GetColumn(tableName);
            GridView gridview = new GridView();
            gridview.DataSource = listColumn;
            gridview.DataBind();
            myPlaceHolder.Controls.Add(gridview);
            
        }
    }
}